package com.douwong.student.rxjava;

import com.douwong.student.model.Account;
import com.douwong.student.model.CourseTab;
import com.douwong.student.model.StatusCode;
import com.douwong.student.model.UserBean;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Query;
import rx.Observable;


/**
 * @autor yichao
 * @time 2017/3/2317:53
 * @des ${TODO}
 */

public interface EndPointInterface {

    String BASEURL = "http://paas.edu.douwong.com/paas/";
  // String HEAD_PIC =  "http://file.eclassedu.com/files/";
    String HEAD_PIC =  "http://file.edu.douwong.com";
    /**
     * 登录
     * @param username
     * @param password
     * @param pfId
     * @param ip
    * @return
            */
    @POST("api/v2/memUser/login.do")
    Observable<StatusCode<UserBean>> login(@Query("username" ) String username,@Query("password") String password,@Query("pfId") String pfId,@Query("ip") String ip);
    /**用户奖励星星*/
    @GET("api/v2/memberCenter/memUser/getUserAccount.do")
    Observable<StatusCode<Account>> getStarNumber(@Query("userId") String userId);
    /**课程表*/
    @POST("api/v2/memberCenter/memSyllabus/classSyllabus.do")
    Observable<StatusCode<List<CourseTab>>> getCourseTab(@Query("classId") String classId);
    /**上传头像*/
    @Multipart
    @POST("ftpupload")
    Observable<StatusCode<String>> uploadPic(@Part MultipartBody.Part photo, @Part("userid")RequestBody userid);
    /**错误日志上传*/
    @Multipart
    @POST("logupload")
    Observable<StatusCode<String>> uploadErrorLog(@PartMap Map<String,RequestBody> params,@Part("deviceType") RequestBody deviceType,@Part("logFileType") RequestBody logFileType);
  @POST("qainteractionlist")
  Call<StatusCode<Object>> getAnswerQuestionList(@Query("page")String page,@Query("subjectid")String subjectid,@Query("type")String type,@Query("class_id") String classId,@Query("create_time")String createTime,@Query("pagenum")int pagenum);

}
